<template>
  <div class="courseshow_container">
    <div class="course_part" v-model="$store.state.course" v-for="item in $store.state.course" @click="getcoursebyclick(item.id)">

        <img :src="item.picture" height="220" width="375" alt="雕刻腹肌-零基础" />
        <div class="description">
          <h4>{{item.name}}</h4>
          <div class="descriptions">
            <span>{{item.aim_name}}</span>&nbsp;
            <span>{{item.grade_level}}</span><br>
            <span class="persons">{{item.persons}}参加训练</span>
          </div>
        </div>
        <div class="mark"></div>

    </div>
  </div>
  </template>
<!--  <coursedetail-main></coursedetail-main>-->

<script>
  import CourseDetail from "../CourseDetail"
  export default {
    name: "CourseShow",
    data(){
      return{
        info:[],
        // coursevideo:{},
        coursedetail:{"coursedetail":"/CourseDetail"}
      }
    },
    components:{"coursedetail-main":CourseDetail},
    created() {
      var this_ = this;
      this.$axios.get('http://127.0.0.1:8080/course/allcourses')
        .then(function (response) {
          console.log(response.data);
          this_.$store.state.course=response.data;
          console.log(this_.info);
        })
    },
    methods:{
      getcoursebyclick:function (id) {
        console.log("ss",id);
        let this_ = this;
        this_.$store.state.courseid = id
        this.$router.push('/coursedetail')

    },
  }}
</script>

<style scoped>
  .courseshow_container{
    display: flex;
    flex-wrap: wrap;
  }
  .course_part{

    background: white;
    width: 375px;
    height: 220px;
    margin-bottom: 30px;
    margin-right: 10px;
    padding: 0;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transition: 0.5s;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;

  }

  .course_part:hover{
    box-shadow: 0 0 6px gray;
    /*transform: translate(0px,-5px);*/
  }
  a{
    text-decoration: none;
    color: black;
  }
  .description h4{
    position:absolute;
    z-index:10;
    top: 40px;
    left: 30px;
    font-size: 24px;
    color: #fff9ea;
 }
  .description .descriptions{
    position:absolute;
    z-index:10;
    top: 85px;
    left: 30px;
    font-size: 18px;
    color: #fff9ea;
  }
  .persons{
    font-size: 14px;
  }
  span{
    font-family: "SimHei";
  }
  .mark{
    /*background: darkgrey;*/
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-color: #464646;
    opacity: .4;
    filter: alpha(opacity=40);
    -webkit-transition: opacity ease 200ms;
    transition: opacity ease 200ms;
    z-index: 4;
    cursor: pointer;
  }
  .mark:hover{
    background-color: #878475;
    transition: 0.5s;

  }
</style>



<!--点击courseid 获取所有视频-->
